<!DOCTYPE html>
<html lang="en-us">

<head>
    <meta name="viewport" content="width=device - width, initial - scale=1.0">
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Watermelon</title>
    <style>
        html, body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden; /* 隐藏滚动条 */
        }

        #unity-container {
            width: 100%;
            height: 100%;
            display: block; /* 或者使用 flex */
        }
    </style>
</head>
<body>
<div id="unity-container">
    <canvas id="unity-canvas" style="width: 100%; height: 100%;"></canvas>
</div>
<script>

    var container = document.querySelector("#unity-container");
    var canvas = document.querySelector("#unity-canvas");

    var buildUrl = "Build";
    var loaderUrl = buildUrl + "/Build.loader.js";
    var config = {
        dataUrl: buildUrl + "/Build.data.gz",
        frameworkUrl: buildUrl + "/Build.framework.js.gz",
        codeUrl: buildUrl + "/Build.wasm.gz",
        streamingAssetsUrl: "StreamingAssets",
        companyName: "DefaultCompany",
        productName: "Watermelon",
        productVersion: "1.0",
        // showBanner: unityShowBanner,
    };

    if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
        // Mobile device style: fill the whole browser client area with the game canvas:
        var meta = document.createElement('meta');
        meta.name = 'viewport';
        meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
        document.getElementsByTagName('head')[0].appendChild(meta);
        container.className = "unity-mobile";
        canvas.className = "unity-mobile";
        // To lower canvas resolution on mobile devices to gain some
        // performance, uncomment the following line:
        // config.devicePixelRatio = 1;
    }

    var script = document.createElement("script");
    script.src = loaderUrl;
    script.onload = () => {
        createUnityInstance(canvas, config, (progress) => {
        }).then((unityInstance) => {
        }).catch((message) => {
            alert(message);
        });
    };

    document.body.appendChild(script);
    
</script>
<script src="//cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
</body>
</html>
